package com.yupi.yuoj.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yupi.yuoj.model.dto.content.ContentQueryRequest;
import com.yupi.yuoj.model.entity.Content;
import com.yupi.yuoj.model.vo.ContentVO;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;

/**
* @author admin
* @description 针对表【content(学习内容表)】的数据库操作Service
* @createDate 2025-11-01 21:28:58
*/
public interface ContentService extends IService<Content> {

    /**
     * 校验内容
     *
     * @param content
     * @param add
     */
    void validContent(Content content, boolean add);

    /**
     * 获取内容封装
     *
     * @param content
     * @param request
     * @return
     */
    ContentVO getContentVO(Content content, HttpServletRequest request);

    /**
     * 获取查询包装类
     *
     * @param contentQueryRequest
     * @return
     */
    QueryWrapper<Content> getQueryWrapper(ContentQueryRequest contentQueryRequest);

    /**
     * 分页获取内容封装
     *
     * @param contentPage
     * @param request
     * @return
     */
    Page<ContentVO> getContentVOPage(Page<Content> contentPage, HttpServletRequest request);

}
